package services;

import entity.Customer;
import entity.Order;
import entity.Products;
import entity.Supplier;

import java.io.FileNotFoundException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Vector;

public interface Service {
    public Map<String, Products> getProductMap();

	public Map<String, Supplier> getSupplierMap();

	public Map<String, Customer> getCustomerMap();

	public Map<String, Order> getOrderMap();

	void close() throws FileNotFoundException;

	// which -> 0:Products, 1:Supplier, 2:Customer, 3:Order
	// 新添
	public int insertById(int which,Object object) throws Exception;

	// 根据id逻辑删除
	public int deleteById(int which,String id) throws Exception;

	// 根据id更新
	public int update(int which,Object object) throws Exception;

	// 根据id查询
	public List selectById(int which, String id) throws Exception;

	public Vector<Vector> selectVectorById(int which, String name) throws Exception;

	// 根据名称查询
	public Vector<Vector> selectByName(int which,String name) throws Exception;

	Vector<Vector> selectByIds(int which, ArrayList<String> ids, ArrayList<Integer> amounts) throws Exception;

	// 列出所有信息
	public Vector<Vector> selectAllVexctor(int which) throws Exception;

	public Map<String,String> selectAllIdName(int which);

	public Vector<Vector> selectProductsbyOrder(String id) throws Exception;
}
